package InputOutputStreamDemo;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class ReadSomething {
    public static void main(String[] args) {
        String filePath = "b.txt";
        String contentToAppend = "2023-05-31: NullPointException";

        try (BufferedWriter writer = new BufferedWriter(new FileWriter(filePath, true))) {
            writer.write(contentToAppend);
            writer.newLine(); // 添加换行符，以便下一次写入时在新的一行开始
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
